package com.heartech.prediciton_wx.service.message;

import com.heartech.prediciton_wx.entity.message.ImageMessage;
import com.heartech.prediciton_wx.entity.message.TextMessage;
import com.heartech.prediciton_wx.entity.message.VideoMessage;
import com.heartech.prediciton_wx.entity.message.VoiceMessage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import static com.heartech.prediciton_wx.utils.message.XmlHandle.*;

@Slf4j
@Service
public class MessageXmlService {
    /* 文本信息信息转换为xml */
    public static String textMessageToXml(TextMessage textMessage) {
        log.warn("ParseXml类TextMessage对象值如下：\n" + textMessage.toString());
        //真正用来处理的方法，也在本类中
        return XmlHandleFun(textMessage);
    }

    /* 关注、扫码事件信息转换为xml，未扫码情况 */
    public static String eventToXml(TextMessage textMessage) {
        log.warn("ParseXml类event对象值如下：\n" + textMessage.toString());
        return XmlHandleFunEventPic(textMessage);
    }

    /* 关注、扫码事件信息转换为xml，已扫码情况 */
    public static String eventToXmlText(TextMessage textMessage) {
        log.warn("ParseXml类event对象值如下：\n" + textMessage.toString());
        return XmlHandleFunEvent(textMessage);
    }

    //图片处理  暂时无实现
    public static String imageMessageToXml(ImageMessage imageMessage) {
        log.warn("ParseXml类ImageMessage对象值如下：\n" + imageMessage.toString());
        return "";
    }

    //音频处理 暂时无实现
    public static String voiceMessageToXml(VoiceMessage voiceMessage) {
        log.warn("ParseXml类VoiceMessage对象值如下：\n" + voiceMessage.toString());
        return "";
    }

    //视频处理 暂时无实现
    public static String videoMessageToXml(VideoMessage videoMessage) {
        log.warn("ParseXml类VideoMessage对象值如下：\n" + videoMessage.toString());
        return "";
    }
}
